#include "SQLRollbackStatement.h"
#include "../SQLExpr.h"
#include "../SQLObject.h"
#include "../SQLName.h"
#include "../../../DbType.h"
#include "../../visitor/SQLASTVisitor.h"

SQLRollbackStatement::SQLRollbackStatement()
{
}

SQLRollbackStatement::SQLRollbackStatement(DbType_ptr  dbType) : SQLStatementImpl(dbType)
{
}

void SQLRollbackStatement::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLRollbackStatement)))
  {
    acceptChild(visitor, to);

    acceptChild(visitor, force);
  }
  visitor->endVisit(SharedObject(SQLRollbackStatement));
}

SQLObject_list_ptr  SQLRollbackStatement::getChildren()
{
  SQLObject_list_ptr  children = std::make_shared<std::list<SQLObject_ptr>>();
  if (to != NULL)
  {
    children->push_back(to);
  }
  if (force != NULL)
  {
    children->push_back(force);
  }
  return children;
}

SQLName_ptr SQLRollbackStatement::getTo()
{
  return to;
}

void SQLRollbackStatement::setTo(SQLName_ptr to)
{
  this->to = to;
}

BOOL_ptr SQLRollbackStatement::getChain()
{
  return chain;
}

void SQLRollbackStatement::setChain(BOOL_ptr chain)
{
  this->chain = chain;
}

BOOL_ptr SQLRollbackStatement::getRelease()
{
  return release;
}

void SQLRollbackStatement::setRelease(BOOL_ptr release)
{
  this->release = release;
}

SQLExpr_ptr SQLRollbackStatement::getForce()
{
  return force;
}

void SQLRollbackStatement::setForce(SQLExpr_ptr force)
{
  this->force = force;
}
